﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Microsoft.Practices.EnterpriseLibrary.Logging;

namespace AudioCore.Common
{
    public struct Priority
    {
        public const int Lowest = 0;
        public const int Low = 1;
        public const int Normal = 2;
        public const int High = 3;
        public const int Highest = 4;
    }

    public struct Category
    {
        public const string General = "General";
        public const string Trace = "Trace";
    }

    public class LoggingHelper
    {
        static int eventID = 0;
        public static void Write(string message)
        {
            Logger.Write(message, Category.Trace, Priority.Normal);
        }

        public static void Write(string format, params object[] args)
        {
            Logger.Write(string.Format(format,args), Category.Trace, Priority.Normal);
        }

        public static void WriteError(string message)
        {
            Logger.Write(message, Category.Trace, Priority.Normal, eventID, System.Diagnostics.TraceEventType.Error);
        }

        public static void WriteError(string format, params object[] args)
        {
            Logger.Write(string.Format(format, args), Category.Trace, Priority.Normal,eventID,System.Diagnostics.TraceEventType.Error);
        }

        public static void WriteInformation(string message)
        {
            Logger.Write(message, Category.Trace, Priority.Normal, eventID, System.Diagnostics.TraceEventType.Information);
        }

        public static void WriteInformation(string format, params object[] args)
        {
            Logger.Write(string.Format(format, args), Category.Trace, Priority.Normal, eventID, System.Diagnostics.TraceEventType.Information);
        }

        public static void WriteWarning(string message)
        {
            Logger.Write(message, Category.Trace, Priority.Normal, eventID, System.Diagnostics.TraceEventType.Warning);
        }

        public static void WriteWarning(string format, params object[] args)
        {
            Logger.Write(string.Format(format, args), Category.Trace, Priority.Normal, eventID, System.Diagnostics.TraceEventType.Warning);
        }

    }
}
